<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    <p></p>
    <p></p>
    <p></p>
    <p></p>
</body>
<script>

    // Array.prototype.sum = function(){
    //     return this.reduce((prev, val)=>prev+val, 0)
    // }
    // Array.prototype.avg = function(){
    //     return this.sum() / this.length;
    // }

    // const arr = [5,7,3,8,2];
    // console.log( arr.sum() );

    // console.log( arr.avg() );

    // const arr2 = [6,7,8,3,4];
    // console.log( arr2.sum() );
    // console.log( arr2.avg() );

    // console.log( [24354,762,3745].sum() )
    // console.log( [24354,762,3745].avg() )


    // console.log(Object.prototype.toString.call(undefined));
    // console.log(Object.prototype.toString.call(null));
    // console.log(Object.prototype.toString.call("hello"));
    // console.log(Object.prototype.toString.call(123));
    // console.log(Object.prototype.toString.call({}));
    // console.log(Object.prototype.toString.call([]));
    
    // console.log( {} instanceof Array );
    // console.log( [] instanceof Array );
    // console.log( {} instanceof Object );
    
    const ap = document.querySelectorAll("p")
    
    // console.log( ap instanceof Array );
    // console.log(Object.prototype.toString.call(ap));
    
    // console.log(Object.prototype.toString.call(new Set()));
    // console.log(Object.prototype.toString.call(new Map()));



    // 伪数组转真数组

    // const arr = Array.prototype.slice.call(ap);

    // arr.filter(val=>{
    //     console.log(val);
    // })

    // arr.push("hello");

    // console.log( arr instanceof Array );

    // console.log(arr);




    
</script>
</html>